import { useContext } from 'react';
import { Context as BanksContext } from '../contexts/Blackhole';
import { Bank, ContractName } from '../basis-cash';

const useBankBlack = (contractName: ContractName): Bank => {
  const { blackholes } = useContext(BanksContext);
  return blackholes.find((bank) => bank.contract === contractName);
};

export default useBankBlack;
